;;;Posted By Ian_Bryant on http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/
;;;Topic title: "quicker alternative changing annotative scale in objectcale"
;;;on 04-14-2013 at 04:46 AM in reply to: boatman38
;;;original function/command name C:CH-ASC
(defun C:ANNOSCL ( / anno-v ent dict cansc test oce);sc-list entsc 
 (setq anno-v (getvar "ANNOALLVISIBLE")
       sc-list NIL
       entsc NIL
 )
 (setvar "ANNOALLVISIBLE" 1)
 (if (= (getvar "CVPORT") 1)
  (princ "\nIn Paperspace. ")
  (if (setq ent (ssget ":S:L"))
   (if
    (and
     (setq dict (cdr (assoc 360 (entget (setq ent (ssname ent 0))))))
     (setq dict (dictsearch dict "AcDbContextDataManager"))
     (setq dict (dictsearch (cdr (assoc -1 dict)) "ACDB_ANNOTATIONSCALES"))
    )
    (progn
      (setq cansc (getvar "CANNOSCALE") oce (getvar "CMDECHO"))
      (foreach n dict
        (if (and
              (= (car n) 350)
              (setq entsc
                   (cdr (assoc 300 (entget (cdr (assoc 340 (entget (cdr n)))))))
              )
            )
          (PROGN
            (if (= entsc cansc)
                (setq test T)
                (setq sc-list (cons entsc sc-list))
            )
          )
        )
      )
      (setvar "CMDECHO" 0)
      (if (not test)
          (command "-objectscale" ent "" "_a" cansc "")
      )
      (if sc-list 
          (progn
             (command "-objectscale" ent "" "_d")
             (foreach n sc-list (command n))
             (command "")
          )
      )
      (setvar "CMDECHO" oce)
    )
    (princ "\nObject selected is not annotative. ") 
   )
  )
 )
 (setvar "ANNOALLVISIBLE" anno-v)
 (princ)
)
